<template>
  <view class="evaluation-card">
    <view class="evaluation-container flex-row justify-between items-center">
      <view class="flex-col">
        <span class="text-size-lg flex">{{ record.name }}</span>
        <span class="mt-4 text-secondary flex">{{ record.date }}</span>
      </view>
      <view class="flex-col">
        <span class="mt-4 flex">评测分数：{{ record.score }}分</span>
        <span class="mt-4 flex">评测结果：{{ record.result }}</span>
      </view>
    </view>
  </view>
</template>

<script lang="ts" setup>
import { ref, defineProps } from 'vue'

interface EvaluationRecord {
  name: string
  date: string
  score: number
  result: string
}

// 定义props
const props = defineProps<{
  record: EvaluationRecord
}>()

// 使用props传递的数据
const record = ref<EvaluationRecord>(props.record)
</script>

<style lang="scss" scoped>
.evaluation-card {
  max-width: 600px;
  padding: 20px;
  margin: 20px auto;
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgb(0 0 0 / 10%);
}

.evaluation-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;

  &:last-child {
    margin-bottom: 0;
  }
}

.text-size-lg {
  font-size: 20px;
  font-weight: bold;
  color: #333;
}

.text-secondary {
  font-size: 14px;
  color: #888;
}

span {
  display: block;
  margin-top: 4px;
  color: #666;
}

.mt-4 {
  margin-top: 10px;
}
</style>
